﻿@using WebGridExDemo.Helpers
@model WebGridExDemo.Models.IndexViewModel

@{
    Layout = null;
    var grid = Html.GridFor(m => m.Contacts);
    grid.AddColumn().HeaderHtml("#").FooterHtml(Html.DisplayFor(m => m.ContactCount)).FooterAttribute("style", "text-align: right");    
    grid.AddColumn(r => r.FirstName);
    grid.AddColumn(r => r.LastName);
    grid.AddColumn().CellHtml(@<div><em>@item.Model.FirstName</em><strong>@item.Model.LastName</strong></div>).HeaderHtml("Custom Html");
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
</head>
<body>
    <div>
        @grid.GetHtml()
    </div>
</body>
</html>
